package com.woniu.mapper;

import com.woniu.entity.RbacRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author 16289
 * @description 针对表【rbac_role】的数据库操作Mapper
 * @createDate 2022-09-02 15:52:53
 * @Entity com.woniu.entity.RbacRole
 */
@Mapper
public interface RbacRoleMapper {

    List<RbacRole> findAll(RbacRole role);

    int findCountByName(String name);

    int insertOne(RbacRole role);

    int deleteOne(int id);

    int findCountByNameOrId(RbacRole role);

    int updateOne(RbacRole role);

    Set<String> findOneByName(String username);

    int updateRoleStatus(Integer id, String status);

    int findCountByNameOrIdOrCode(RbacRole role);

    List<Integer> findMenuIDByRoleID(int roleId);

    int removeMenuByRoleID(@Param("roleid") Integer roleID,
                           @Param("menuid") Integer menuID);

    int addMenuByRoleID(@Param("roleid") Integer roleID,
                        @Param("menuid") Integer menuID);

    void deleteAllMenuByRoleID(@Param("roleid") Integer roleID);
}
